package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.PushRecordDetail;
import com.baseweb.webadmin.core.model.pojo.PushRecordDetailExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface PushRecordDetailMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int countByExample(PushRecordDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int deleteByExample(PushRecordDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    @Delete({
        "delete from push_record_detail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    @Insert({
        "insert into push_record_detail (record_id, userid, ",
        "channel_avatar, channel_id, ",
        "channel_user_id, push_channel_id, ",
        "device_id, device_type, ",
        "gender, is_ota, is_shell, ",
        "login_name, lower_login_name, ",
        "push_type, status, ",
        "create_time, ",
        "update_time)",
        "values (#{recordId,jdbcType=INTEGER}, #{userid,jdbcType=VARCHAR}, ",
        "#{channelAvatar,jdbcType=VARCHAR}, #{channelId,jdbcType=VARCHAR}, ",
        "#{channelUserId,jdbcType=VARCHAR}, #{pushChannelId,jdbcType=VARCHAR}, ",
        "#{deviceId,jdbcType=VARCHAR}, #{deviceType,jdbcType=INTEGER}, ",
        "#{gender,jdbcType=INTEGER}, #{isOta,jdbcType=INTEGER}, #{isShell,jdbcType=INTEGER}, ",
        "#{loginName,jdbcType=VARCHAR}, #{lowerLoginName,jdbcType=VARCHAR}, ",
        "#{pushType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(PushRecordDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int insertSelective(PushRecordDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    List<PushRecordDetail> selectByExample(PushRecordDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    @Select({
        "select",
        "id, record_id, userid, channel_avatar, channel_id, channel_user_id, push_channel_id, ",
        "device_id, device_type, gender, is_ota, is_shell, login_name, lower_login_name, ",
        "push_type, status, create_time, update_time",
        "from push_record_detail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    PushRecordDetail selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int updateByExampleSelective(@Param("record") PushRecordDetail record, @Param("example") PushRecordDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int updateByExample(@Param("record") PushRecordDetail record, @Param("example") PushRecordDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    int updateByPrimaryKeySelective(PushRecordDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table push_record_detail
     *
     * @mbggenerated Thu Sep 11 18:04:01 CST 2014
     */
    @Update({
        "update push_record_detail",
        "set record_id = #{recordId,jdbcType=INTEGER},",
          "userid = #{userid,jdbcType=VARCHAR},",
          "channel_avatar = #{channelAvatar,jdbcType=VARCHAR},",
          "channel_id = #{channelId,jdbcType=VARCHAR},",
          "channel_user_id = #{channelUserId,jdbcType=VARCHAR},",
          "push_channel_id = #{pushChannelId,jdbcType=VARCHAR},",
          "device_id = #{deviceId,jdbcType=VARCHAR},",
          "device_type = #{deviceType,jdbcType=INTEGER},",
          "gender = #{gender,jdbcType=INTEGER},",
          "is_ota = #{isOta,jdbcType=INTEGER},",
          "is_shell = #{isShell,jdbcType=INTEGER},",
          "login_name = #{loginName,jdbcType=VARCHAR},",
          "lower_login_name = #{lowerLoginName,jdbcType=VARCHAR},",
          "push_type = #{pushType,jdbcType=INTEGER},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PushRecordDetail record);
}